<?php

/**
 * Product form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseProductForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'product_id'      => new sfWidgetFormInputHidden(),
      'product_line_id' => new sfWidgetFormInput(),
      'title'           => new sfWidgetFormTextarea(),
      'version'         => new sfWidgetFormInput(),
      'artist_id'       => new sfWidgetFormInput(),
      'description'     => new sfWidgetFormTextarea(),
      'category'        => new sfWidgetFormInput(),
      'product_type_id' => new sfWidgetFormPropelChoice(array('model' => 'ProductType', 'add_empty' => false)),
      'type'            => new sfWidgetFormInput(),
      'weight'          => new sfWidgetFormInput(),
      'created'         => new sfWidgetFormDateTime(),
      'modified'        => new sfWidgetFormDateTime(),
      'release_date'    => new sfWidgetFormDate(),
      'publisher_id'    => new sfWidgetFormPropelChoice(array('model' => 'Publisher', 'add_empty' => false, 'key_method' => 'getAccountId')),
      'cost'            => new sfWidgetFormInput(),
      'retail_price'    => new sfWidgetFormInput(),
      'units'           => new sfWidgetFormInput(),
      'in_stock'        => new sfWidgetFormInput(),
      'on_hold'         => new sfWidgetFormInput(),
      'on_hand'         => new sfWidgetFormInput(),
      'status'          => new sfWidgetFormInput(),
      'availability'    => new sfWidgetFormInput(),
      'backorder_date'  => new sfWidgetFormInput(),
      'regcode_script'  => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'product_id'      => new sfValidatorPropelChoice(array('model' => 'Product', 'column' => 'product_id', 'required' => false)),
      'product_line_id' => new sfValidatorInteger(array('required' => false)),
      'title'           => new sfValidatorString(),
      'version'         => new sfValidatorString(array('max_length' => 16, 'required' => false)),
      'artist_id'       => new sfValidatorInteger(array('required' => false)),
      'description'     => new sfValidatorString(array('required' => false)),
      'category'        => new sfValidatorString(array('max_length' => 32, 'required' => false)),
      'product_type_id' => new sfValidatorPropelChoice(array('model' => 'ProductType', 'column' => 'product_type_id')),
      'type'            => new sfValidatorString(array('max_length' => 32, 'required' => false)),
      'weight'          => new sfValidatorInteger(array('required' => false)),
      'created'         => new sfValidatorDateTime(array('required' => false)),
      'modified'        => new sfValidatorDateTime(array('required' => false)),
      'release_date'    => new sfValidatorDate(array('required' => false)),
      'publisher_id'    => new sfValidatorPropelChoice(array('model' => 'Publisher', 'column' => 'account_id')),
      'cost'            => new sfValidatorNumber(),
      'retail_price'    => new sfValidatorNumber(array('required' => false)),
      'units'           => new sfValidatorInteger(array('required' => false)),
      'in_stock'        => new sfValidatorInteger(array('required' => false)),
      'on_hold'         => new sfValidatorInteger(array('required' => false)),
      'on_hand'         => new sfValidatorInteger(array('required' => false)),
      'status'          => new sfValidatorInteger(array('required' => false)),
      'availability'    => new sfValidatorInteger(array('required' => false)),
      'backorder_date'  => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'regcode_script'  => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('product[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Product';
  }


}
